package sockettest;

import java.net.ServerSocket;
import java.net.Socket;

public class ServeSockeTest {
    public static void main(String[] arge) {
        try {
            ServerSocket server = null;
            try {
                server = new ServerSocket(8080);
                System.out.println("服务器启动成功");
            } catch (Exception e) {
                System.out.println("服务器启动出错");
            }
            Socket socket = null;
            try {
                socket = server.accept();
                System.out.println("链接socket成功");
                ServerThread st = new ServerThread(socket);
                st.start();
                ;
            } catch (Exception e) {
                e.printStackTrace();
            }
        }finally {

        }
    }
}
